<template>
  <div class="tree">
    <TreeNode v-for="node in treeData" :key="node.label" :node="node" @node-click="handleClick" :selected_id="selected_id"></TreeNode>
  </div>
</template>
<script>
import TreeNode from "./treeNode.vue"
export default {
  name: 'Tree',
  components: {
    TreeNode
  },
  props: {
    treeData: Array,
    selected_id: String
  },
  data() {
    return {
     
    }
  },
  methods: {
    handleClick(node) {
      this.$emit('tree-click', node)
    }
  }
}
</script>